package com.ethink.order.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ethink.order.api.info.PurchaseOrderDetailInfo;
import com.ethink.order.api.info.PurchaseOrderInfo;
import com.ethink.order.api.model.PurchaseOrderDetailModel;
import com.ethink.order.api.model.PurchaseOrderNoAndQtyModel;
import com.ethink.order.api.model.PurchaseQuoteQueryModel;
import com.ethink.order.api.model.TransferPurchaseOrderModel;
import com.ethink.order.api.request.*;
import com.ethink.order.common.entity.PurchaseOrderDetail;

import java.util.List;

/**
 * 采购详情单 Service接口
 *
 * @author default
 * @date 2022-10-31
 */
public interface PurchaseOrderDetailService extends IService<PurchaseOrderDetail> {

    void purchaseQuote(PurchaseQuoteRequest request);

    /**
     * 批量绑定采购单号
     * @param ids
     * @param orderNo
     */
    void bulkBindOrderNo(List<Long> ids,String orderNo);


    void saleLock(List<SaleLockRequest> item);

    List<PurchaseOrderDetailModel> queryPrePurchaseOrder(PrePurchaseOrderQueryRequest request);

    Page<PurchaseOrderDetailModel> pageQuery(PurchaseOrderDetailPageQueryRequest request);

    Integer update(PurchaseOrderDetailUpdateRequest request);

    /**
     * 销售解单
     * @param detailOrderNo
     */
    void saleUnlock(String detailOrderNo);

    Integer purchaseDetailDelete(Long id);

    List<PurchaseQuoteQueryModel> purchaseQuoteQuery(String detailOrderNo, String createUserCode);

    List<PurchaseOrderDetailInfo>  winning(String saleDetailOrderNo);

    List<PurchaseOrderDetailInfo> queryPurchaseDetailOrderByDetailOrderNo(String detailOrderNo);

    Integer updateLockOrderQty(LockOrderQtyUpdateRequest request);

    PurchaseOrderDetailInfo queryDetailInfoByDetailId(Long id);

    List<PurchaseOrderNoAndQtyModel> queryPurchaseQty(List<String> orderNos);
}